package com.zhousb.deviceManager.controller;

import com.zhousb.deviceManager.common.R;
import com.zhousb.deviceManager.common.ResponseResult;
import com.zhousb.deviceManager.model.entity.KiClient;
import com.zhousb.deviceManager.service.ClientService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/client")
public class ClientController {
    @Resource
    private ClientService clientService;
    @GetMapping("/list")
    public ResponseResult<?> listClient(@RequestParam(value = "keyword",required = false)String keyword) {
        return R.success(clientService.listClient(keyword));
    }

    @PostMapping("/add")
    public ResponseResult<?> addClient(@RequestBody KiClient kiClient) {
        return R.success(clientService.addClient(kiClient));
    }

    @GetMapping("/delete")
    public ResponseResult<?> delete(@RequestParam("id")String id) {
        return R.success(clientService.delete(id));
    }
}
